#!/usr/bin/python3
# -*- coding: utf-8 -*-

# 爬楼梯
# def climbstairs(n):
#     if n == 1:
#         return 1
#     if n == 2:
#         return 2
#     a,b = 1,2
#     i = 3
#     while i <= n:
#         a,b = b, a + b
#         i += 1
#         print("b",b)
#     return b

# print(climbstairs(10))


# 最大回撤
# def max_drawdown(arr):
#     assert len(arr)>2, "len(arr) should > 2!"
#     x,y = arr[0:2]
#     xmax = x
#     maxdiff = x-y

#     for i in range(2,len(arr)):
#         if arr[i-1] > xmax:
#             xmax = arr[i-1]
#         if xmax - arr[i] > maxdiff:
#             maxdiff = xmax - arr[i]
#             x,y = xmax,arr[i]

#     print("x=",x,",y=",y)
#     return(maxdiff)

# print(max_drawdown([3,7,2,6,4,1,9,8,5]))


# 第几天，星期几
# import time
# date = input("输入时间，如2022-1-23:")
# st = time.strptime(date, '%Y-%m-%d')
# numd = st.tm_yday
# print('第',numd,'天')
# numw = st.tm_wday
# wd = ''
# for i in range(0,7):
#     if(i == numw):
#         if(i <= 5):
#             wd = str(i + 1)
#         elif(i == 6):
#             wd = '日'
# print('星期' + wd)


# 乘法表
# for i in range(1,10):
#     for j in range(1, i + 1):
#         print(" {0} * {1} = {2}".format(i, j, i * j), end="\t")
#     print()


# 质数
# arr = [2, 3]
# for i in range(4, 200):
#     for j in arr:
#         if i % j == 0:
#             break
#     else:
#         print(i)
#         arr.append(i)
# print(arr)


# 水仙花数
# for i in range(100,1000):
#     b = i // 100
#     s = i % 100 //10
#     g = i % 10
#     if (b ** 3 + s ** 3 + g ** 3) == i:
#         print(i)

# 统计字符
# s = input("输入字符串:\n")
# letters, spaces, digitss, others = 0, 0, 0, 0
# for c in s:
#     if c.isalpha():
#         letters += 1
#     elif c.isdigit():
#         digitss += 1
#     elif c.isspace():
#         spaces += 1
#     else:
#         others += 1
# print('char = %d space = %d didit = %d other = %d' % (letters, spaces, digitss, others))

# a = int(input("请输入数字:"))
# t = int(input("请输入位数:"))
# arr = [a]
# res = 0
# for i in range(t):
#     b = arr[-1] + a * (10 ** (i + 1))
#     arr.append(b)
# for i in range(t):
#     res += arr[i]
# print(res)

# import tkinter
# canvas = tkinter.Canvas(width=600, height=500, bg='yellow')
# canvas.pack(expand='yes', fill='both')
# k = 1
# j = 1
# for i in range(0, 26):
#     canvas.create_oval(300 -k, 250 - k, 300 + k, 250 + k, width = 1)
#     k += j
#     j += 0.6
# canvas.mainloop()

foo = [2, 18, 9, 22, 17, 24, 8, 12, 27]
print(list(map(lambda x:x * 2 + 10, foo)))
print(list(filter(lambda x:x % 3 == 0, foo)))
